<template>
  <div class="flex flex-col h-full">
    <SearchContainer @reset="() => formRef.resetFields()" @search="getData">
      <a-form ref="formRef" class="form-style-flex" :model="formState">
        <a-form-item name="pyjm" class="w-64 ml-2">
          <a-input v-model:value="formState.pyjm" placeholder="要素名称" />
        </a-form-item>
      </a-form>
    </SearchContainer>
    <a-card class="mt-2 flex-1">
      <BaseTable column-code="000935" fill :data-source="tableData" bordered :loading="loading" :pagination="false">
        <template #bodyCell="{ column, index, record }">
          <template v-if="column.dataIndex == 'xh'">
            {{ index + 1 }}
          </template>
          <template v-if="column.dataIndex == 'yxztStr'">
            <a-switch v-model:checked="record.yxzt" checked-value="0" un-checked-value="1" @change="onHandleDeactivate(record, $event)" />
          </template>
          <template v-if="column.dataIndex == 'sfpj'">
            {{ record.sfpj == 0 ? '否' : '是' }}
          </template>
        </template>
      </BaseTable>
    </a-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'
// import { message } from 'ant-design-vue'
import SearchContainer from '@/components/SearchContainer'
import BaseTable from '@/components/BaseTable'
// import { post } from '@/utils/request'

const formRef = ref(null)
const formState = ref({
  managementType: '0'
})

const { loading, tableData, getData } = useTable({
  url: '/operation/opex/getPatientlnfoList',
  immediate: true,
  params: formState.value
  // formatResult: (result) => {
  //   result.forEach((i) => (i.advOrderType = 0))
  //   return result
  // }
})
</script>
<style lang="less" scoped>
.ant-picker {
  width: 100%;
}
</style>
